package org.demo.multimodule.config;

import org.demo.multimodule.service.Service;
import org.demo.multimodule.service.ServiceProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(ServiceProperties.class)
public class ServiceConfiguration {

    @Bean
    public Service service(ServiceProperties properties) {
        return new Service(properties.getMessage());
    }
}
